﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class BikeAttributesForm : Form
    {
        public BikeAttributesForm()
        {
            InitiallizeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // 创建包含4个Label的数组
            Label[] labelsToSave = { label1, label2, label3, label4 };

            // 调用保存方法
            SaveLabelsToTextFile(labelsToSave);
        }
        public void SaveLabelsToTextFile(Label[] labels)
        {
            // 参数检查
            if (labels == null || labels.Length == 0)
            {
                MessageBox.Show("未提供有效的Label控件");
                return;
            }
        }
        //第一天以上内容
        // 创建保存文件对话框
        SaveFileDialog saveFileDialog = new SaveFileDialog()
        {
            Filter = "文本文件|*.txt",
            Title = "保存Label文本内容",
            DefaultExt = "txt",
            AddExtension = true
        };
         // 显示对话框并获取结果
           
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
               
            }
            
    }
}
